<template>
	<view>
		<uni-popup ref="prompt_popup" type="dialog">
			<uni-popup-dialog mode="base" title="提示"  :content="content" :duration="2000" :before-close="true"
				@close="close" @confirm="confirm">
			</uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	
	export default {
		name:"tyd-prompt",
		props: {
			content: {
				type: String,
				default () {
					return ''
				}
			},
			sureBtnColor:{
				type: String,
				default () {
					return '#007aff'
				}
			}
		},
		data() {
			return {
				btnColor:''
			};
		},
		methods:{
			open() {
				this.$refs.prompt_popup.open();
				this.btnColor  = this.sureBtnColor;
			},
			/**
			 * 点击取消按钮触发
			 * @param {Object} done
			 */
			close() {
			
				this.$refs.prompt_popup.close()
			},
			/**
			 * 点击确认按钮触发
			 * @param {Object} done
			 * @param {Object} value
			 */
			confirm() {
				this.$emit('confirmPrompt');
				this.$refs.prompt_popup.close()
			},
		}
	}
</script>

<style lang="scss">
	// v-bind('bgColor');
</style>